#ifndef VERIFYCODEWIDGET_H
#define VERIFYCODEWIDGET_H

#include <QWidget>
#include <QRandomGenerator>

class VerifyCodeWidget : public QWidget
{
    Q_OBJECT
public:
    explicit VerifyCodeWidget(QWidget *parent = nullptr);
    //获得四个随机大写字母
    QString getVerifyCode();
    //刷新验证码
    void refreshVerifyCode();
    //自定义绘图
    void paintEvent(QPaintEvent* event) override;
    //点击验证码更新验证码
    void mousePressEvent(QMouseEvent* event) override;
    //判断验证码是否正确(大小写不敏感比较)
    bool isRight(const QString& VerifyCode);
private:
    //随机数生成器
    QRandomGenerator randGenerator;
    //验证码的值
    QString verifyCode ="";

signals:
};

#endif // VERIFYCODEWIDGET_H
